<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
	    <div class="btn-toolbar">
			<if condition="I('get.vid') eq 2">
				<button class="btn btn-primary ifrm" data-url="/goods/addOemGoods" data-width="770" data-height="730" data-title="添加商品" data-params="vid/<?=I('get.vid')?>" style="position:relative;float:right;padding:3px 6px;margin-right:10px">添加商品</button>
			</if>
		    <form>
		    	<label style="display: inline;">商品名称：</label><input class="input input-medium" type="text" name="goods_title" value="<?=I('get.goods_title')?>" />
		    	<label style="display: inline;">&nbsp;&nbsp;商品分类：</label>
				<select name="cate1_id" style="width:150px;" id="setChange">
					<option value="all">全部</option>
					<foreach name="cate" item="vo">
						<option value="{{$vo['cate_id']}}" <if condition="I('get.cate1_id') eq $vo['cate_id']">selected</if> >{{$vo.cate_name}}</option>
					</foreach>
				</select>
				<label style="display: inline;">&nbsp;&nbsp;</label>
				<select name="cate2_id" style="width: 150px" id="applyIn">
					<option value="all">全部</option>
					<if condition="$getCate">
						<foreach name="getCate" item="v">
							<option value="{{$v['cate_id']}}" <if condition="I('get.cate2_id') eq $v['cate_id']">selected</if> >{{$v.cate_name}}</option>
						</foreach>
					</if>
				</select>
		    	<label style="display: inline;">&nbsp;&nbsp;在线状态：</label>
				<select name="status" style="width: 100px">
					<option value="all" <if condition="I('get.status') eq 'all'">selected</if> >全部</option>
					<option value="0" <if condition="I('get.status') eq '0'">selected</if> >下线</option>
					<option value="1" <if condition="I('get.status') eq '1'">selected</if> >在线</option>
				</select>
				<label style="display: inline;">&nbsp;&nbsp;库存状态：</label>
				<select name="kcun" style="width: 100px">
					<option value="all" <if condition="I('get.kcun') eq 'all'">selected</if> >全部</option>
					<option value="1" <if condition="I('get.kcun') eq 1">selected</if> >无库存</option>
					<option value="2" <if condition="I('get.kcun') eq 2">selected</if> >库存充足</option>
				</select>
		    	<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
		</div>
		<hr>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center">商品id</th>
		          <th style="text-align:center">商品图片</th>
		          <th style="text-align:left">商品标题</th>
				  <if condition="I('get.vid') neq 2">
		          <th style="text-align:center">商品类型</th>
				  </if>
		          <th style="text-align:center">库存</th>
		          <th style="text-align:center">销量</th>
		          <th style="text-align:center">商品价格</th>
		          <th style="text-align:center">商品返利</th>
		      	  <th style="text-align:center">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php if($getData){foreach($getData AS $key=>$val){ ?>
		        <tr> 
		          <td style="text-align:center;vertical-align:middle"><?=$val['goods_id']?></td>
		          <td style="text-align:center;vertical-align:middle"><img src="<?=$val['goods_pic']?>" style="width:100px" /></td>
		          <td style="text-align:left;vertical-align:middle"><?=$val['goods_title']?></td>
				  <if condition="I('get.vid') neq 2">
		          <td style="text-align:center;vertical-align:middle">
					  <if condition="$val['taxes'] eq 1">
						  保税仓(完税)
						<elseif condition="$val['taxes'] eq 2"/>
						  保税仓(未完税)
						<elseif condition="$val['taxes'] eq 3"/>
						  大贸(完税)
						<elseif condition="$val['taxes'] eq 4"/>
						  海外直邮(完税)
						<elseif condition="$val['taxes'] eq 5"/>
						  海外直邮(未完税)
						<elseif condition="$val['taxes'] eq 6"/>
						  跨境(未完税)
                        <elseif condition="$val['taxes'] eq 7"/>
                          跨境(完税)
					  </if>
				  </td>
				  </if>
		          <td style="text-align:center;vertical-align:middle"><?=$val['kcun']?> 件</td>
		          <td style="text-align:center;vertical-align:middle"><?=$val['sales']?> 件</td>
		          <td style="text-align:center;vertical-align:middle"><?=$val['goods_price']?> / <?=$val['goods_attr']?></td>
		          <td style="text-align:center;vertical-align:middle">店长<b><?=$val['hjprofit']?></b>元 / 经理<b><?=$val['byprofit']?></b>元 / 总监<b><?=$val['zsprofit']?></b>元 </td>
		          <td style="text-align:center;vertical-align:middle">
		          <if condition="I('get.vid') eq 2">
		              <a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/goods/addOemGoods/vid/<?=I('get.vid')?>" data-width="770" data-height="730" style="padding: 0px 4px;" data-title="修改项目" data-params="goods_id/<?=$val['goods_id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;
		          </if>
		          <if condition="I('get.vid') eq 1">
		              <a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/goods/addGoods/vid/<?=I('get.vid')?>" data-width="770" data-height="730" style="padding: 0px 4px;" data-title="修改项目" data-params="goods_id/<?=$val['goods_id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;
		          </if>
		              <a href="/goods/deGoods?goods_id=<?=$val['goods_id']?>" style="padding: 0px 4px;" class="deproject btn btn-danger" title="删除该商品" role="button" data-toggle="modal"><i class="icon-remove"></i></a>
		          </td>
		        </tr>
		        <?php }}else{?>
		        <tr><td style="text-align:center;vertical-align:middle" colspan=8>暂无数据</td></tr>
		        <?php }?>
		      </tbody>
		   </table>
		   <span style="float:right;margin-top:-44px"><?=$page?></span>
	</div>
</div>
<script>
$(function(){
	$('.deproject').live('click',function(){
		if(!window.confirm('确认删除吗 ?')){
			return false;
		}
		window.location = $(this).attr('href');
	});
	$('.hoverTag').click(function(){
		_thish = $(this);
		art.dialog({
		    fixed: true,
		    content: '<div style="width:300px;text-align:left"><h3>项目亮点：</h3><p>'+_thish.attr('cons')+'</p><h3>市场分析：</h3><p>'+_thish.attr('cons_market')+'</p></div>',
		    width: '390px',
		    title: '项目详情'
		});
	});

	$('#setChange').change(function() {
		optionHtml = '<option value="all">全部</option>';
		if($(this).val()!='all'){
			$.get('/goods/cates', {'ajaxFrom': '1', 'cateid': $(this).val()}, function (data) {
				if (data.length) {
					for (var i = 0; i < data.length; i++) {
						optionHtml += '<option value=' + data[i].cate_id + '>' + data[i].cate_name + '</option>';
					}
					$('#applyIn').html(optionHtml);
				} else {
					optionHtml = '<option>没有行业数据</option>';
				}
			}, 'json');
		}else{
			$('#applyIn').html(optionHtml);
		}
	});
})
</script>